package eteam.aps.api;

import java.lang.reflect.Field;

/**
 * @author LiuLei
 */
public class Util {

    public static void printObjFiled(Class<?> target, boolean firstReplace, String prefix) {
        StringBuilder sb = new StringBuilder();
        for (Field field : target.getDeclaredFields()) {
            String name = field.getName();
            char[] array = name.toCharArray();
            int index = 0;
            if (firstReplace) index = 1;
            if (prefix != null && !prefix.trim().equals("")) sb.append(prefix);
            sb.append(new String(array, index, array.length - 1)).append(",").append("\n");
        }
        String substring = sb.substring(0, sb.length() - ",\n".length());
        System.out.println(substring);
    }

}
